package com.corona.game;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Filter;
import com.corona.Game;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryonet.EndPoint;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;

/* loaded from: pokewilds.jar:com/pkmngen/game/Network.class */
public class Network {
    public static final int port;

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$BattleTurnData.class */
    public static class BattleTurnData {
        boolean oppFirst;
        Attack playerAttack;
        Attack enemyAttack;
        String itemName;
        int numWobbles;
        boolean runSuccessful;
        String playerTrappedBy = null;
        int playerTrapCounter = 0;
        String enemyTrappedBy = null;
        int enemyTrapCounter = 0;
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$MapTiles.class */
    public static class MapTiles {
        int interiorTilesIndex;
        int dayTimer;
        public ArrayList<TileData> tiles = new ArrayList<>();
        public HashMap<String, RouteData> routes = new HashMap<>();
        public ArrayList<Vector2> edges = new ArrayList<>();
        public ArrayList<HashMap<Vector2, TileData>> interiorTiles = new ArrayList<>();
        String timeOfDay = null;
    }

    public static void register(EndPoint endPoint) {
        Kryo kryo = endPoint.getKryo();
        kryo.register(Vector2.class);
        kryo.register(Filter.class);
        kryo.register(ArrayList.class);
        kryo.register(HashMap.class);
        kryo.register(String[].class);
        kryo.register(Color.class);
        kryo.register(MapTiles.class);
        kryo.register(TileDataBase.class);
        kryo.register(Login.class);
        kryo.register(Logout.class);
        kryo.register(PlayerDataBase.class);
        kryo.register(PokemonDataBase.class);
        kryo.register(MovePlayer.class);
        kryo.register(Pokemon.Generation.class);
        kryo.register(ServerPlayerData.class);
        kryo.register(BattleData.class);
        kryo.register(BattleTurnData.class);
        kryo.register(Attack.class);
        kryo.register(DoBattleAction.class);
        kryo.register(Battle.DoTurn.Type.class);
        kryo.register(RelocatePlayer.class);
        kryo.register(RouteData.class);
        kryo.register(UseHM.class);
        kryo.register(UseItem.class);
        kryo.register(Sleep.class);
        kryo.register(Craft.class);
        kryo.register(DropItem.class);
        kryo.register(DropPokemon.class);
        kryo.register(PausePokemon.class);
        kryo.register(SaveData.class);
        kryo.register(PickupItem.class);
        kryo.register(LearnMove.class);
        kryo.register(MovePokemon.class);
        kryo.register(OverworldPokemonData.class);
        kryo.register(PlayerDataV06.class);
        kryo.register(PokemonDataV04.class);
        kryo.register(PokemonDataV05.class);
        kryo.register(PlayerDataV07.class);
        kryo.register(PokemonDataV07.class);
        kryo.register(GameSaveData.class);
        kryo.register(MapSaveData.class);
        kryo.register(PlayerData.class);
        kryo.register(PokemonData.class);
        kryo.register(TileData.class);
        kryo.register(PlayerSpawnLocationData.class);
        kryo.register(LinkedHashMap.class);
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$ActionData.class */
    public static class ActionData {
        String className;
        String objectId;
        Object[] params;
        ActionData nextAction;

        public ActionData(Action action) {
            this.className = action.getClass().toString();
            this.params = action.params;
            for (int i = 0; i < this.params.length; i++) {
                Object param = this.params[i];
                if (param instanceof Action) {
                    this.params[i] = new ActionData((Action) param);
                }
            }
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$BattleData.class */
    public static class BattleData {
        PokemonData pokemonData;
        String playerId;

        public BattleData() {
            this.playerId = null;
        }

        public BattleData(Pokemon pokemon) {
            this.playerId = null;
            this.pokemonData = new PokemonData(pokemon);
        }

        public BattleData(Pokemon pokemon, String playerId) {
            this(pokemon);
            this.playerId = playerId;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$Craft.class */
    public static class Craft {
        String playerId;
        int craftIndex;
        int amount;

        public Craft() {
        }

        public Craft(String playerId, int craftIndex, int amount) {
            this.playerId = playerId;
            this.craftIndex = craftIndex;
            this.amount = amount;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$DoBattleAction.class */
    public static class DoBattleAction {
        String playerId;
        String attack;
        String itemName;
        int pokemonIndex;
        Battle.DoTurn.Type type;

        public DoBattleAction() {
            this.type = Battle.DoTurn.Type.ATTACK;
        }

        public DoBattleAction(String playerId, Battle.DoTurn.Type type, int pokemonIndex) {
            this(playerId, type);
            this.pokemonIndex = pokemonIndex;
        }

        public DoBattleAction(String playerId, Battle.DoTurn.Type type, String action) {
            this(playerId, type);
            this.attack = action;
            this.itemName = action;
        }

        public DoBattleAction(String playerId, Battle.DoTurn.Type type) {
            this.type = Battle.DoTurn.Type.ATTACK;
            this.playerId = playerId;
            this.type = type;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$DropItem.class */
    public static class DropItem {
        String playerId;
        String itemName;
        int amount;
        Vector2 pos;

        public DropItem() {
        }

        public DropItem(String playerId, String itemName, int amount, Vector2 pos) {
            this.playerId = playerId;
            this.itemName = itemName;
            this.amount = amount;
            this.pos = pos;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$DropPokemon.class */
    public static class DropPokemon {
        String playerId;
        int index;
        String dirFacing;
        boolean pickingUp;
        boolean pausing;
        Vector2 pos;

        public DropPokemon() {
            this.pausing = false;
        }

        public DropPokemon(String playerId, Vector2 pos) {
            this.pausing = false;
            this.playerId = playerId;
            this.pos = pos;
            this.pickingUp = true;
        }

        public DropPokemon(String playerId, String dirFacing, boolean pausing) {
            this.pausing = false;
            this.playerId = playerId;
            this.dirFacing = dirFacing;
            this.pausing = pausing;
        }

        public DropPokemon(String playerId, int index, String dirFacing) {
            this.pausing = false;
            this.playerId = playerId;
            this.index = index;
            this.dirFacing = dirFacing;
            this.pickingUp = false;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$LearnMove.class */
    public static class LearnMove {
        String playerId;
        int pokemonIndex;
        int replaceIndex;
        String moveName;

        public LearnMove() {
        }

        public LearnMove(String playerId, int pokemonIndex, int replaceIndex, String moveName) {
            this.playerId = playerId;
            this.pokemonIndex = pokemonIndex;
            this.replaceIndex = replaceIndex;
            this.moveName = moveName;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$Login.class */
    public static class Login {
        public String playerId;
        Color color;

        public Login() {
        }

        public Login(String playerId, Color color) {
            this.playerId = playerId;
            this.color = color;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$Logout.class */
    public static class Logout {
        public String playerId;

        public Logout() {
        }

        public Logout(String playerId) {
            this.playerId = playerId;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$MovePlayer.class */
    public static class MovePlayer {
        String playerId;
        public String dirFacing;
        boolean isRunning;

        public MovePlayer() {
        }

        public MovePlayer(String playerId, String dirFacing, boolean isRunning) {
            this.playerId = playerId;
            this.dirFacing = dirFacing;
            this.isRunning = isRunning;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$MovePokemon.class */
    public static class MovePokemon {
        Vector2 position;
        public String dirFacing;

        public MovePokemon() {
        }

        public MovePokemon(Pokemon pokemon) {
            this.position = pokemon.position;
            this.dirFacing = pokemon.dirFacing;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$OverworldPokemonData.class */
    public static class OverworldPokemonData extends PokemonData {
        Vector2 overworldPos;
        boolean remove;

        public OverworldPokemonData() {
            this.remove = false;
        }

        public OverworldPokemonData(Pokemon pokemon, Vector2 position, boolean remove) {
            this(pokemon, position);
            this.remove = remove;
        }

        public OverworldPokemonData(Pokemon pokemon, Vector2 position) {
            super(pokemon);
            this.remove = false;
            this.overworldPos = position;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PausePokemon.class */
    public static class PausePokemon {
        String playerId;
        Vector2 position;
        boolean shouldPause;

        public PausePokemon() {
        }

        public PausePokemon(String playerId, Vector2 position, boolean shouldPause) {
            this.playerId = playerId;
            this.position = position;
            this.shouldPause = shouldPause;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PickupItem.class */
    public static class PickupItem {
        String playerId;
        String dirFacing;
        Vector2 pos;

        public PickupItem() {
        }

        public PickupItem(String playerId, String dirFacing) {
            this.playerId = playerId;
            this.dirFacing = dirFacing;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PlayerDataBase.class */
    public static class PlayerDataBase {
        public Vector2 position;
        public String name;
        ArrayList<PokemonData> pokemon;
        PokemonData currPokemon;
        Map<String, Integer> itemsDict;
        String id;
        String number;
        Color color;
        String dirFacing;
        public Vector2 spawnLoc;
        boolean isInterior;
        boolean displayedMaxPartyText;
        boolean isFlying;
        int flyingIndex;

        public PlayerDataBase() {
            this.flyingIndex = 0;
        }

        public PlayerDataBase(Player player) {
            this.flyingIndex = 0;
            this.position = player.position.cpy();
            this.position.x -= this.position.x % 16.0f;
            this.position.y -= this.position.y % 16.0f;
            this.name = player.name;
            this.pokemon = new ArrayList<>();
            Iterator<Pokemon> it = player.pokemon.iterator();
            while (it.hasNext()) {
                this.pokemon.add(new PokemonData(it.next()));
            }
            if (player.currPokemon != null) {
                this.currPokemon = new PokemonData(player.currPokemon);
            }
            this.itemsDict = player.getItemsDict();
            this.id = player.network.id;
            this.number = player.network.number;
            this.color = player.color;
            this.dirFacing = player.dirFacing;
            this.spawnLoc = player.spawnLoc;
            this.displayedMaxPartyText = player.displayedMaxPartyText;
            this.isFlying = player.currFieldMove.equals("FLY");
            if (player.flyingAction != null) {
                this.flyingIndex = player.pokemon.indexOf(player.flyingAction.pokemon);
            }
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PlayerDataV06.class */
    public static class PlayerDataV06 extends PlayerDataBase {
        public int spawnIndex;

        public PlayerDataV06() {
            this.spawnIndex = -1;
        }

        public PlayerDataV06(Player player) {
            super(player);
            this.spawnIndex = -1;
            this.spawnIndex = player.spawnIndex;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PlayerDataV07.class */
    public static class PlayerDataV07 extends PlayerDataV06 {
        String character;
        Color skinColor;
        boolean enteredDesertBiome;

        public PlayerDataV07() {
            this.character = "gold";
            this.skinColor = new Color(1.0f, 0.80784315f, 0.28235295f, 1.0f);
            this.enteredDesertBiome = false;
        }

        public PlayerDataV07(Player player) {
            super(player);
            this.character = "gold";
            this.skinColor = new Color(1.0f, 0.80784315f, 0.28235295f, 1.0f);
            this.enteredDesertBiome = false;
            this.character = player.character;
            this.skinColor = player.skinColor;
            this.enteredDesertBiome = player.enteredDesertBiome;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PlayerData.class */
    public static class PlayerData extends PlayerDataV07 {
        String currFieldMove;
        int fieldMovePokemonIndex;

        public PlayerData() {
            this.currFieldMove = null;
            this.fieldMovePokemonIndex = -1;
        }

        public PlayerData(Player player) {
            super(player);
            this.currFieldMove = null;
            this.fieldMovePokemonIndex = -1;
            if (player.hmPokemon != null) {
                this.currFieldMove = player.currFieldMove;
                this.fieldMovePokemonIndex = player.pokemon.indexOf(player.hmPokemon);
            }
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PokemonDataBase.class */
    public static class PokemonDataBase {
        String name;
        int level;
        Pokemon.Generation generation;
        int hp;
        boolean isShiny;
        String[] attacks;
        int index;
        String status;
        String previousOwnerName;
        Vector2 position;
        boolean isInterior;
        int harvestTimer;

        public PokemonDataBase() {
            this.attacks = new String[4];
            this.status = null;
            this.previousOwnerName = null;
            this.isInterior = false;
            this.harvestTimer = 0;
        }

        public PokemonDataBase(Pokemon pokemon) {
            this.attacks = new String[4];
            this.status = null;
            this.previousOwnerName = null;
            this.isInterior = false;
            this.harvestTimer = 0;
            this.name = pokemon.specie.name;
            this.level = pokemon.level;
            this.generation = pokemon.generation;
            this.isShiny = pokemon.isShiny;
            this.hp = pokemon.currentStats.get("hp").intValue();
            this.attacks[0] = pokemon.attacks[0];
            this.attacks[1] = pokemon.attacks[1];
            this.attacks[2] = pokemon.attacks[2];
            this.attacks[3] = pokemon.attacks[3];
            this.position = pokemon.position;
            if (pokemon.mapTiles != null) {
                this.isInterior = pokemon.mapTiles != Game.staticGame.map.overworldTiles;
            }
            this.status = pokemon.status;
            this.harvestTimer = pokemon.harvestTimer;
            if (pokemon.previousOwner != null) {
                this.previousOwnerName = pokemon.previousOwner.name;
            }
        }

        public PokemonDataBase(Pokemon pokemon, int index) {
            this(pokemon);
            this.index = index;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PokemonDataV04.class */
    public static class PokemonDataV04 extends PokemonDataBase {
        public boolean test = false;

        public PokemonDataV04() {
        }

        public PokemonDataV04(Pokemon pokemon) {
            super(pokemon);
        }

        public PokemonDataV04(Pokemon pokemon, int index) {
            super(pokemon, index);
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PokemonDataV05.class */
    public static class PokemonDataV05 extends PokemonDataV04 {
        public String gender;
        public String eggHatchInto;
        public int friendliness;
        public boolean aggroPlayer;

        public PokemonDataV05() {
            this.gender = null;
            this.eggHatchInto = null;
            this.friendliness = 0;
            this.aggroPlayer = false;
        }

        public PokemonDataV05(Pokemon pokemon) {
            super(pokemon);
            this.gender = null;
            this.eggHatchInto = null;
            this.friendliness = 0;
            this.aggroPlayer = false;
            this.gender = pokemon.gender;
            if (pokemon.isEgg) {
                this.eggHatchInto = pokemon.specie.name;
                this.name = "egg";
            }
            this.friendliness = pokemon.happiness;
            this.aggroPlayer = pokemon.aggroPlayer;
        }

        public PokemonDataV05(Pokemon pokemon, int index) {
            super(pokemon, index);
            this.gender = null;
            this.eggHatchInto = null;
            this.friendliness = 0;
            this.aggroPlayer = false;
            this.gender = pokemon.gender;
            if (pokemon.isEgg) {
                this.eggHatchInto = pokemon.specie.name;
                this.name = "egg";
            }
            this.friendliness = pokemon.happiness;
            this.aggroPlayer = pokemon.aggroPlayer;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PokemonDataV07.class */
    public static class PokemonDataV07 extends PokemonDataV05 {
        public String nickname;
        public int interiorIndex;

        public PokemonDataV07() {
            this.nickname = null;
            this.interiorIndex = 100;
        }

        public PokemonDataV07(Pokemon pokemon) {
            super(pokemon);
            this.nickname = null;
            this.interiorIndex = 100;
            this.nickname = pokemon.nickname;
            this.interiorIndex = pokemon.interiorIndex;
        }

        public PokemonDataV07(Pokemon pokemon, int index) {
            super(pokemon, index);
            this.nickname = null;
            this.interiorIndex = 100;
            this.nickname = pokemon.nickname;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PokemonData.class */
    public static class PokemonData extends PokemonDataV07 {
        public int exp;

        public PokemonData() {
            this.exp = 1;
        }

        public PokemonData(Pokemon pokemon) {
            super(pokemon);
            this.exp = 1;
            this.exp = pokemon.exp;
        }

        public PokemonData(Pokemon pokemon, int index) {
            super(pokemon, index);
            this.exp = 1;
            this.exp = pokemon.exp;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$RelocatePlayer.class */
    public static class RelocatePlayer {
        Vector2 position;

        public RelocatePlayer() {
        }

        public RelocatePlayer(Vector2 position) {
            this.position = position.cpy();
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$RouteData.class */
    public static class RouteData {
        String classId;
        String name;
        int level;
        ArrayList<PokemonData> pokemon;
        ArrayList<String> allowedPokemon;
        ArrayList<String> musics;
        int musicsIndex;

        public RouteData() {
            this.pokemon = new ArrayList<>();
            this.musicsIndex = 0;
        }

        public RouteData(Route route) {
            this.pokemon = new ArrayList<>();
            this.musicsIndex = 0;
            this.classId = route.toString();
            this.name = route.name;
            this.level = route.level;
            this.musicsIndex = route.musicsIndex;
            Iterator<Pokemon> it = route.storedPokemon.iterator();
            while (it.hasNext()) {
                this.pokemon.add(new PokemonData(it.next()));
            }
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$SaveData.class */
    public static class SaveData {
        PlayerDataBase playerData;
        MapTiles mapTiles = new MapTiles();
        ArrayList<PlayerDataBase> players = new ArrayList<>();
        HashMap<Vector2, PokemonDataBase> overworldPokemon = new HashMap<>();

        public SaveData() {
        }

        /* JADX DEBUG: Multi-variable search result rejected for r0v65, resolved type: java.util.ArrayList<java.util.HashMap<com.badlogic.gdx.math.Vector2, com.corona.game.Network$TileData>> */
        /* JADX WARN: Multi-variable type inference failed */
        public SaveData(Game game) {
            for (Tile tile : game.map.overworldTiles.values()) {
                if (tile.routeBelongsTo != null && !this.mapTiles.routes.containsKey(tile.routeBelongsTo.toString())) {
                    this.mapTiles.routes.put(tile.routeBelongsTo.toString(), new RouteData(tile.routeBelongsTo));
                }
                this.mapTiles.tiles.add(new TileData(tile));
            }
            Iterator<HashMap<Vector2, Tile>> it = game.map.interiorTiles.iterator();
            while (it.hasNext()) {
                HashMap<Vector2, Tile> tiles = it.next();
                HashMap<Vector2, TileData> tileDatas = null;
                if (tiles != null) {
                    tileDatas = new HashMap<>();
                    for (Tile tile2 : tiles.values()) {
                        if (tile2.routeBelongsTo != null && !this.mapTiles.routes.containsKey(tile2.routeBelongsTo.toString())) {
                            this.mapTiles.routes.put(tile2.routeBelongsTo.toString(), new RouteData(tile2.routeBelongsTo));
                        }
                        tileDatas.put(tile2.position, new TileData(tile2));
                    }
                }
                this.mapTiles.interiorTiles.add(tileDatas);
            }
            this.mapTiles.interiorTilesIndex = game.map.interiorTilesIndex;
            this.mapTiles.edges = game.map.edges;
            this.mapTiles.timeOfDay = game.map.timeOfDay;
            this.mapTiles.dayTimer = CycleDayNight.dayTimer;
            for (Player player : game.players.values()) {
                this.players.add(new PlayerData(player));
            }
            this.playerData = new PlayerData(game.player);
            this.playerData.isInterior = game.map.tiles != game.map.overworldTiles;
            for (Vector2 pos : game.map.pokemon.keySet()) {
                this.overworldPokemon.put(pos, new PokemonData(game.map.pokemon.get(pos)));
            }
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$GameSaveData.class */
    public static class GameSaveData {
        ArrayList<PlayerData> players;
        PlayerData playerData;
        String currMapId;
        String timeOfDay;
        int dayTimer;
        ArrayList<String> alreadyUsedDungeons;

        public GameSaveData() {
            this.players = new ArrayList<>();
            this.alreadyUsedDungeons = new ArrayList<>();
        }

        public GameSaveData(Game game) {
            this.players = new ArrayList<>();
            this.alreadyUsedDungeons = new ArrayList<>();
            this.timeOfDay = game.map.timeOfDay;
            this.dayTimer = CycleDayNight.dayTimer;
            this.currMapId = game.map.currMapId;
            for (Player player : game.players.values()) {
                this.players.add(new PlayerData(player));
            }
            this.playerData = new PlayerData(game.player);
            this.playerData.isInterior = game.map.tiles != game.map.overworldTiles;
            this.alreadyUsedDungeons = game.alreadyUsedDungeons;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$MapSaveData.class */
    public static class MapSaveData {
        MapTiles mapTiles = new MapTiles();
        HashMap<Vector2, PokemonData> overworldPokemon = new HashMap<>();

        public MapSaveData() {
        }

        /* JADX DEBUG: Multi-variable search result rejected for r0v49, resolved type: java.util.ArrayList<java.util.HashMap<com.badlogic.gdx.math.Vector2, com.corona.game.Network$TileData>> */
        /* JADX WARN: Multi-variable type inference failed */
        public MapSaveData(Game game) {
            this.mapTiles.timeOfDay = game.map.timeOfDay;
            this.mapTiles.dayTimer = CycleDayNight.dayTimer;
            for (Tile tile : game.map.overworldTiles.values()) {
                if (tile.routeBelongsTo != null && !this.mapTiles.routes.containsKey(tile.routeBelongsTo.toString())) {
                    this.mapTiles.routes.put(tile.routeBelongsTo.toString(), new RouteData(tile.routeBelongsTo));
                }
                this.mapTiles.tiles.add(new TileData(tile));
            }
            Iterator<HashMap<Vector2, Tile>> it = game.map.interiorTiles.iterator();
            while (it.hasNext()) {
                HashMap<Vector2, Tile> tiles = it.next();
                HashMap<Vector2, TileData> tileDatas = null;
                if (tiles != null) {
                    tileDatas = new HashMap<>();
                    for (Tile tile2 : tiles.values()) {
                        if (tile2.routeBelongsTo != null && !this.mapTiles.routes.containsKey(tile2.routeBelongsTo.toString())) {
                            this.mapTiles.routes.put(tile2.routeBelongsTo.toString(), new RouteData(tile2.routeBelongsTo));
                        }
                        tileDatas.put(tile2.position, new TileData(tile2));
                    }
                }
                this.mapTiles.interiorTiles.add(tileDatas);
            }
            this.mapTiles.interiorTilesIndex = game.map.interiorTilesIndex;
            this.mapTiles.edges = game.map.edges;
            for (Vector2 pos : game.map.pokemon.keySet()) {
                this.overworldPokemon.put(pos, new PokemonData(game.map.pokemon.get(pos)));
            }
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$PlayerSpawnLocationData.class */
    public static class PlayerSpawnLocationData {
        Vector2 position;
        int spawnIndex;

        public PlayerSpawnLocationData() {
        }

        public PlayerSpawnLocationData(Player player) {
            this.position = player.spawnLoc;
            this.spawnIndex = player.spawnIndex;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$ServerPlayerData.class */
    public static class ServerPlayerData {
        public Vector2 position;
        public String name;
        String number;
        Color color;
        boolean isInterior;

        public ServerPlayerData() {
        }

        public ServerPlayerData(Player player) {
            this.position = player.position;
            this.name = player.name;
            this.number = player.network.number;
            this.color = player.color;
            this.isInterior = player.network.tiles != Game.staticGame.map.overworldTiles;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$Sleep.class */
    public static class Sleep {
        String playerId;
        boolean isSleeping;

        public Sleep() {
        }

        public Sleep(String playerId, boolean isSleeping) {
            this.playerId = playerId;
            this.isSleeping = isSleeping;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$TileDataBase.class */
    public static class TileDataBase {
        public Vector2 pos;
        public String tileName;
        public String tileNameUpper;
        String routeBelongsTo;
        HashMap<String, Integer> items;
        public String hasItem;
        public int hasItemAmount;
        String biome;
        boolean isUnown;
        String message;
        int interiorIndex;
        ArrayList<Vector2> doorTiles;

        public TileDataBase() {
            this.message = "";
        }

        public TileDataBase(Tile tile, int interiorIndex) {
            this(tile);
            this.interiorIndex = interiorIndex;
        }

        public TileDataBase(Tile tile) {
            this.message = "";
            this.pos = tile.position.cpy();
            this.tileName = tile.name;
            this.tileNameUpper = tile.nameUpper;
            if (tile.routeBelongsTo != null) {
                this.routeBelongsTo = tile.routeBelongsTo.toString();
            }
            if (TrainerTipsTile.class.isInstance(tile)) {
                TrainerTipsTile tTile = (TrainerTipsTile) tile;
                this.isUnown = tTile.isUnown;
                this.message = tTile.message;
            }
            this.items = tile.items;
            this.hasItem = tile.hasItem;
            this.hasItemAmount = tile.hasItemAmount;
            this.doorTiles = tile.doorTiles;
            this.biome = tile.biome;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$TileData.class */
    public static class TileData extends TileDataBase {
        public String squishedTiles;

        public TileData() {
            this.squishedTiles = null;
        }

        public TileData(Tile tile) {
            super(tile);
            this.squishedTiles = null;
            this.squishedTiles = tile.squishedTiles;
        }

        public TileData(Tile tile, int interiorIndex) {
            super(tile, interiorIndex);
            this.squishedTiles = null;
            this.squishedTiles = tile.squishedTiles;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$UseHM.class */
    public static class UseHM {
        String playerId;
        int pokemonIndex;
        String hm;
        String dirFacing;
        int movePos;

        public UseHM() {
        }

        public UseHM(String playerId, int pokemonIndex, String hm, int movePos) {
            this(playerId, pokemonIndex, hm);
            this.movePos = movePos;
        }

        public UseHM(String playerId, int pokemonIndex, String hm, String dirFacing) {
            this(playerId, pokemonIndex, hm);
            this.dirFacing = dirFacing;
        }

        public UseHM(String playerId, int pokemonIndex, String hm) {
            this.playerId = playerId;
            this.pokemonIndex = pokemonIndex;
            this.hm = hm;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$UseItem.class */
    public static class UseItem {
        String playerId;
        String item;
        String dirFacing;

        public UseItem() {
        }

        public UseItem(String playerId, String item, String dirFacing) {
            this.playerId = playerId;
            this.item = item;
            this.dirFacing = dirFacing;
        }
    }

    /* loaded from: pokewilds.jar:com/pkmngen/game/Network$SyncedHashMap.class */
    public static class SyncedHashMap {
        String name;
        String operation;
        Object putgetMe;

        public SyncedHashMap() {
        }

        public SyncedHashMap(String name, String operation, Object putgetMe) {
            this.name = name;
            this.operation = operation;
            this.putgetMe = putgetMe;
        }
    }
}
